{% extends "h:templates/layouts/admin.html.jinja2" %}

{% from '../includes/search_form.html.jinja2' import search_form %}

{% set page_id = 'organizations' %}
{% set page_title = 'Organizations' %}

{% block content %}

  {{ search_form('Search by name…', request.params.get('q')) }}

  <div class="table-responsive">
    <table class="table table-striped">
      <thead>
        <tr>
          <th>Name</th>
        </tr>
      </thead>
      <tbody>
        {% for org in results %}
          <tr>
            <td>
              {% set edit_url = request.route_url('admin.organizations_edit', pubid=org.pubid) %}
              <a href="{{ edit_url }}">{{ org.name }}</a>
            </td>
          </tr>
        {% endfor %}
      </tbody>
    </table>
  </div>

  {% include "h:templates/includes/paginator.html.jinja2" %}
{% endblock %}
